1. Field of the Invention The present invention relates to a 2-dimensional code reader which reads information contained in a code-region where a 2-dimensional code is printed.
2. Description of Related Art
Generally, a 2-dimensional code is read in the following manner. A 2-dimensional image containing a 2-dimensional code therein is optically read by a camera such as a CCD (a charge coupled device), and a region in which the 2-dimensional code is printed is separated from the 2-dimensional image. Then, information contained in each cell of the 2-dimensional code in a form of black and white pattern is detected by a code reader, and the detected information is converted into normal characters. The 2-dimensional code contains more information than a single dimensional bar code.
A conventional device for reading the 2-dimensional code usually includes an amplifier having automatic gain control (an AGC amplifier). A gain of the amplifier is automatically controlled by a negative feedback method based on a level of an average signal level fed from a camera. In this manner, an amplifying rate of the amplifier is reduced when the image scanned by the camera is bright, and is increased when the image is dark, so that an output from the amplifier becomes constant, not influenced by brightness of the 2-dimensional image fed from the camera.
However, the 2-dimensional image fed from the camera includes not only an image of a 2-dimensional code but also other images than the code, and accordingly the amplifying rate controlled based on a brightness of the whole image may not be suitable for detecting the code itself. Some examples having various brightness of the image are shown in FIGS. 4A-4B. In an example shown in FIG. 4A, a small 2-dimensional code (code 1) is printed on a white background. In FIG. 4B, a relatively large code (code 2) is printed on a white background. In FIG. 4C, a relatively large code (code 3) is printed on a black background. In FIG. 4D, a small code is printed on a black background. If a standard amplifying rate of the amplifier is set to be suitable to read the code 2, the code 1 may not be read properly, because the amplifying rate is set at a low level because a brightness of a whole image including code 1 is very bright. On the other hand, in case of code 3, the amplifying rate is set at a high level because a brightness of a whole image including code 3 is low. Therefore, the code 3 may not be properly detected. In case of code 4, the whole image taken by the camera is further dark, and accordingly the amplifying rate is controlled at a further high level, which may cause saturation of the amplifier output.